package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.vo.AdminHomeVO;
import com.ruoyi.system.domain.vo.DataStatisticsVO;
import com.ruoyi.system.mapper.AdminHomeMapper;
import com.ruoyi.system.service.AdminHomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class AdminHomeServiceImpl implements AdminHomeService {

    @Autowired
    private AdminHomeMapper adminHomeMapper;
    @Override
    public AdminHomeVO SelectArticleoAll(){

       AdminHomeVO SAT= adminHomeMapper.SelectArticleoTal();

        AdminHomeVO STT= adminHomeMapper.SelectTagTotal();

        AdminHomeVO SUT= adminHomeMapper.SelectUserVTotal();

        AdminHomeVO SUVT=adminHomeMapper.SelectUserVipTotal();

        SAT.setTagTotal(STT.getTagTotal());

        SAT.setUserTotal(SUT.getUserTotal());

        SAT.setVipUserTotal(SUVT.getVipUserTotal());

        List<DataStatisticsVO> list =adminHomeMapper.SelectDataStatistics();
        //把list集合set到SAT中
            SAT.setDataStatistics(list);

             return SAT ;

    }

}
